/**
 * @author aimicheng
 */
 
function ModalGuide(opts){
	var me = this;
	//可视区域大小
	this.viewsize_ = {
		width:opts.width,
		height:opts.height
	}
	
	//可视区域位置
	this.viewpos_ = {
		left:opts.left,
		top:opts.top
	}
	
	//窗口大小
	this.winsize_ = {
		width:0,
		height:0
	}
	
	//modalguide-box-l
	this.box_left_ = $("<div class='modalguide-box-l'></div>");
	
	//modalguide-box-t
	this.box_top_ = $("<div class='modalguide-box-t'></div>");

	//modalguide-box-b
	this.box_bottom_ = $("<div class='modalguide-box-b'></div>");
	
	//modalguide-box-r
	this.box_right_ = $("<div class='modalguide-box-r'></div>");
	
	this.update();
	
	$(document.body).append(this.box_left_).append(this.box_top_).append(this.box_bottom_).append(this.box_right_);
	$(window).resize(function(){
		me.update();
	});
}


ModalGuide.prototype.update = function(data){
	if(data){
		//this.viewsize_
		this.viewsize_.width = data.width;
		this.viewsize_.height = data.height;
		
		this.viewpos_.left = data.left;
		this.viewpos_.top = data.top;
	}
	
	//窗口大小
	this.winsize_.width = $(window).width();
	this.winsize_.height = $(window).height();
	
	this.box_left_.width(this.viewpos_.left).height(this.winsize_.height);
	
	this.box_top_.width(this.viewsize_.width).height(this.viewpos_.top);
	this.box_top_.css({left:this.viewpos_.left});
	
	this.box_bottom_.width(this.viewsize_.width).height(this.winsize_.height - this.viewpos_.top - this.viewsize_.height);
	this.box_bottom_.css({left:this.viewpos_.left});
	
	this.box_right_.width(this.winsize_.width - this.viewpos_.left - this.viewsize_.width).height(this.winsize_.height);
}
